import { View, Text,Image } from '@tarojs/components'
import Taro,{ useLoad } from '@tarojs/taro'
import './index.scss'
const successPage = 'https://wanhuhealth.oss-cn-beijing.aliyuncs.com/static/mini-jifen/images/success.png'
export default function BindSuccess () {
  useLoad(() => {
    console.log('Page loaded.')
  })
  function addInsurance() {
    Taro.navigateTo({
      url: '/pages/addInsurance/index'
    })
  }
  // 跳转到首页
  // 定义一个goIndex函数，用于跳转到指定页面
  function goIndex(){
    // 使用Taro的navigateTo方法跳转到指定页面
    Taro.navigateTo({
      // 指定跳转的页面路径
      url: '/pages/index/index'
    })
  }
  return (
    <View className='bindSuccess-page'>
      <View className='success-image-wrap'>
      <Image src={successPage} className='success-image' mode='aspectFit'></Image>
      </View>
      <View className='success-text'>绑定完成</View>
      <View className='duihuan-text' onClick={addInsurance}>兑换万户健康保</View>
      <View className='back-text' onClick={goIndex}>返回首页</View>

    </View>
  )
}
